package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {


    @Select("SELECT t1.name,t1.`options` FROM tb_spec AS t1 INNER JOIN tb_category AS t2 ON t1.template_id=t2.template_id where t2.`parent_id`<>0 AND  t2.`name`=#{categoryName}")
    List<Map> findSpecListByCategoryName(@Param("categoryName") String categoryName);
}
